//
//  MyViewController.m
//  HeartTravel
//
//  Created by dlios on 15-6-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MyViewController.h"

@interface MyViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,retain)UIView *headerView;
@property(nonatomic,retain)UITableView *myTableView;
@property(nonatomic,retain)NSArray *arr;

@end

@implementation MyViewController
-(void)dealloc{
    [_headerView release];
    [_myTableView release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent=YES;
    self.arr=@[@"我的收藏",@"我的分享",@"清除缓存"];
    self.headerView =[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 250)];
    self.headerView.backgroundColor=[UIColor grayColor];
    UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.headerView.frame.size.width, self.headerView.frame.size.height)];
    imageView.image=[UIImage imageNamed:@"u=3658902293,305025286&fm=21&gp=0.jpg"];
    [self.headerView addSubview:imageView];
    [self.view addSubview:self.headerView];
    self.myTableView= [[UITableView alloc]init];
    self.myTableView.frame=CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-49);
    self.myTableView.delegate=self;
    self.myTableView.dataSource=self;
    self.myTableView.tableHeaderView=self.headerView;
    [self.view addSubview:self.myTableView];
    [self.headerView release];
    [self.myTableView release];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arr.count;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * reuse=@"reuse";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:reuse];
    if (!cell) {
        cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuse]autorelease];
    }
    cell.textLabel.text=self.arr[indexPath.row];
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if ([self.arr[indexPath.row]isEqualToString: @"清除缓存"]) {
        <#statements#>
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
